package util;

public class ProjectUtil {

    public static String getRandomNumberString(Integer decimals) {
        return ((int) (Math.random() * Math.pow(10, decimals))) + "";
    }

    public static String getRandomNumberString() {
        return getRandomNumberString(3);
    }

    public static String getFormated(String str, String... arg) {
        for (int i = 0; i < arg.length; i++)
            str = str.replaceAll("##" + i, firstUpper(arg[i]))
                     .replaceAll("#" + i, arg[i]);
        return str;
    }

    public static String firstUpper(String str) {
        return Character.toUpperCase(str.charAt(0)) + str.substring(1);
    }
}
